/*
 * Copyright (C) 2013 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cyy.user.textbluetoothble.utils;

import java.util.HashMap;

/**
 * This class includes a small subset of standard GATT attributes for demonstration purposes.
 * 这一类包括用于示范标准关贸总协定属性的一部分。
 */
public class SampleGattAttributes {
    private static HashMap<String, String> attributes = new HashMap();
    public static String HEALTH_SMOKE_INFO = "0000ffe0-0000-1000-8000-00805f9b34fb";
    public static String HEALTH_SMOKE_CMD = "0000ffe1-0000-1000-8000-00805f9b34fb";
    public static String HEALTH_SMOKE_PARA_TO_APP = "0000ffe2-0000-1000-8000-00805f9b34fb";
    public static String HEALTH_SMOKE_PARA_FROM_APP = "0000ffe3-0000-1000-8000-00805f9b34fb";
    public static String HEALTH_SMOKE_PICT_FROM_APP = "0000ffe4-0000-1000-8000-00805f9b34fb";
    public static String CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb";

    public static String HEALTH_OAD_IDENTIFY = "f000ffc1-0451-4000-b000-000000000000";
    public static String HEALTH_OAD_BLOCK = "f000ffc2-0451-4000-b000-000000000000";
    public static String HEALTH_CONN_SET = "0000ccc2-0000-1000-8000-00805f9b34fb";

    static {
        // Sample Services.
    		attributes.put("00001800-0000-1000-8000-00805f9b34fb", "Generic Access Profile");
    		attributes.put("00001801-0000-1000-8000-00805f9b34fb", "Generic Attribute Profile");
    		attributes.put("0000ff00-0000-1000-8000-00805f9b34fb", "Health Smoke Service");
            attributes.put("0000180d-0000-1000-8000-00805f9b34fb", "Heart Rate Service");
            attributes.put("0000180a-0000-1000-8000-00805f9b34fb", "Device Information Service");
    		attributes.put("f000ffc0-0451-4000-b000-000000000000", "Health OAD Service");
    		attributes.put("0000ccc0-0000-1000-8000-00805f9b34fb", "Health connect control Service");
				
        // Sample Characteristics.
        attributes.put(HEALTH_SMOKE_INFO, "Health smoke info");
        attributes.put(HEALTH_SMOKE_CMD, "Health smoke commond");
        attributes.put(HEALTH_SMOKE_PARA_TO_APP, "Health smoke para to app");
        attributes.put(HEALTH_SMOKE_PARA_FROM_APP, "Health smoke para from app");
        attributes.put(HEALTH_SMOKE_PICT_FROM_APP, "Health PICT from app");
        attributes.put(HEALTH_OAD_IDENTIFY, "Health OAD Indetify");
        attributes.put(HEALTH_OAD_BLOCK, "Health OAD Block");
        attributes.put(HEALTH_CONN_SET, "Health Conn set");
       	attributes.put("00002a29-0000-1000-8000-00805f9b34fb", "Manufacturer Name String");
    }

    public static String lookup(String uuid, String defaultName) {
        String name = attributes.get(uuid);
        return name == null ? defaultName : name;
    }
}
